<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<title>公告发布</title>
		<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css" />
		<link rel="stylesheet" type="text/css" href="../../static/css/me.css" th:href="@{/css/me.css}"/>
	</head>
	<body>
		<!-- 主体 -->
		<div class="ui container margin-t-small">
			<form th:object="${news}" class="ui form" th:action="@{/admin/new}" method="post">
				<input type="hidden" name="id" th:value="*{id}">
				<div class="ui segment">
					标题：
					<div class="ui field input">
						<input type="text" name="title" th:value="*{title}" placeholder="标题" />
					</div>
					<p>内容：</p>
					<div class="field">
						<textarea name="content" th:text="*{content}">
						</textarea>
					</div>
					<div class="ui right aligned basic segment">
						<button class="ui button" onclick="window.history.go(-1)">返回</button>
						<button type="submit" class="ui blue button">发布</button>
					</div>
				</div>
			</form>
		</div>



		<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
		<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
		<script>
			$('.ui.dropdown').dropdown();
			$('.ui.form')
					.form({
						fields: {
							title: {
								identifier: 'title',
								rules: [{
									type: 'empty',
									prompt: '标题不能为空'
								}]
							},
							content: {
								identifier: 'content',
								rules: [{
									type: 'empty',
									prompt: '内容不能为空'
								}]
							}
						}
					});
		</script>
	</body>
</html>
